package com.pzr.soccer.controller;

import com.pzr.soccer.model.LoginForm;
import com.pzr.soccer.model.LoginResult;
import com.pzr.soccer.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author pzr
 * @date:2021-12-21-14:04
 * @Description:
 **/
@RestController
public class UserLoginController {
@Autowired
    LoginService loginService;
    @PostMapping("/login")
    public LoginResult login(@RequestBody LoginForm form){
        System.out.printf("hello,%s,handling your login",form.getUsername());
            return loginService.login(form.getUsername(),form.getPassword());
    }

}
